﻿using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using Mes.Domain.BoundedContext.Entities.WorkOrders;

namespace Mes.Infrastructure.Data.BoundedContext.EntityTypeConfigurations.WorkOrders
{
    public class JobStepEntityConfig : IEntityTypeConfiguration<JobStep>
    {
        public void Configure(EntityTypeBuilder<JobStep> builder)
        {
            builder.ToTable("job_step");
            builder.HasKey(e => new { e.Wo_Id, e.Oper_Id, e.Seq_No, e.Step_No, e.Step_Grp_Id });
            builder.Property(e => e.Row_Id).IsRequired().UseIdentityColumn().HasIdentityOptions(startValue: 0, incrementBy: 1, minValue: 0);
        }
    }
}
